package cn.yuli.decorator.impl;

import cn.yuli.component.Beverage;
import cn.yuli.decorator.Condiment;
/**
 * 装饰模式：摩卡装饰器
 * @author yuli
 *
 */
public class Mocha extends Beverage implements Condiment{
	Beverage beverage;//被装饰组件，相当于上一个对象
	
	public Mocha(Beverage beverage) {
		super();
		this.beverage = beverage;
	}
	
	@Override
	public String getDescription() {
		return beverage.getDescription() + ",摩卡";
	}

	@Override
	public double cost() {
		return .99 + beverage.cost();
	}

}
